Communication apparatus

ABSTRACT

A communication apparatus performs communication processing in the first communication mode and the second communication mode to set a communication period of the first communication mode per unit time to be longer than that of the second communication mode in a case where both the first communication mode and the second communication mode are enabled, a communication partner apparatus in the first communication mode is determined, and a communication partner apparatus in the second communication mode is not determined.

CROSS-REFERENCE TO RELATED APPLICATIONS

The present application is a continuation of U.S. patent applicationSer. No. 17/344,456, filed on Jun. 10, 2021, which claims priority fromJapanese Patent Application No. 2020-111974 filed Jun. 29, 2020, whichare hereby incorporated by reference herein in their entireties.

BACKGROUND Field

The present invention relates to a communication apparatus.

Description of the Related Art

There are communication apparatuses capable of operating in a pluralityof communication modes, like performing wireless communication in aninfrastructure mode and a direct mode in parallel, as discussed inJapanese Patent Application Publication Laid-Open No. 2014-216956.

The use of wireless communications has been increasing in recent years,and there has been a demand to improve the convenience of wirelesscommunications.

The present disclosure is directed to improving the convenience ofwireless communications.

SUMMARY

According to an aspect of the present invention, a communicationapparatus that includes a communication unit configured to perform afirst communication mode in which the communication unit communicateswith a terminal apparatus via wireless communication with an externalwireless base station and a second communication mode in which thecommunication unit directly performs wireless communication with theterminal apparatus without intervention of the external wireless basestation, the communication apparatus includes a setting unit configuredto enable at least either one of the first communication mode and thesecond communication mode, and a control unit configured to performcommunication processing in the first communication mode and the secondcommunication mode to set a communication period of the firstcommunication mode per unit time to be longer than that of the secondcommunication mode in a case where both the first communication mode andthe second communication mode are enabled, a communication partnerapparatus in the first communication mode is determined, and acommunication partner apparatus in the second communication mode is notdetermined, and perform the communication processing in the firstcommunication mode and the second communication mode to set thecommunication period of the second communication mode per unit time tobe longer than that of the first communication mode in a case where boththe first communication mode and the second communication mode areenabled, the communication partner apparatus in the second communicationmode is determined, and the communication partner apparatus in the firstcommunication mode is not determined.

Further features of the present invention will become apparent from thefollowing description of exemplary embodiments with reference to theattached drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a diagram illustrating an example of a system configuration.

FIG. 2 is a diagram illustrating an example of an external configurationof a portable communication terminal apparatus.

FIG. 3 is a diagram illustrating an example of an external configurationof a multifunction peripheral (MFP).

FIGS. 4A, 4B, and 4C are diagrams each illustrating an example of anoperation display unit of the MFP.

FIG. 5 is a block diagram illustrating a configuration example of theportable communication terminal apparatus.

FIG. 6 is a block diagram illustrating a configuration example of theMFP.

FIG. 7 is a sequence diagram illustrating an example of a device searchsequence in mode A (software access point (AP) mode).

FIG. 8 is a sequence diagram illustrating an example of a device searchsequence in mode B (Wi-Fi Direct (WFD) mode).

FIG. 9 is a sequence diagram illustrating an example of a device searchsequence in mode C (wireless infrastructure mode).

FIG. 10 is a sequence diagram illustrating an example of a device searchsequence in mode D (Bluetooth® Low Energy mode).

FIG. 11 is a sequence diagram illustrating an example of a device searchsequence in mode E (Bluetooth® mode).

FIG. 12 is a diagram illustrating an example of an interface selectionscreen upon initial activation.

FIG. 13 is a flowchart illustrating an example of a procedure ofinterface processing upon initial activation.

FIG. 14 is a flowchart illustrating an example of a procedure ofinterface processing by local area network (LAN) setting.

FIG. 15 is a flowchart illustrating an example of a wirelessinfrastructure mode enabling processing sequence.

FIG. 16 is a flowchart illustrating an example of a wirelessinfrastructure mode disabling processing sequence.

FIG. 17 is a flowchart illustrating an example of a peer-to-peer (P2P)mode enabling processing sequence.

FIG. 18 is a flowchart illustrating an example of a P2P mode disablingprocessing sequence.

FIG. 19 is a flowchart illustrating an example of a procedure ofprocessing for selecting and setting a wireless control setting table.

FIGS. 20A, 20B, 20C and 20D are diagrams illustrating examples ofwireless control setting tables.

FIGS. 21A, 21B, 21C, and 21D are diagrams illustrating examples ofcommunication periods set based on the respective wireless controlsetting tables.

DESCRIPTION OF THE EMBODIMENTS

Exemplary embodiments of the present disclosure will be described indeal below with reference to the drawings. It should be noted that theexemplary embodiments are just examples, and specific examples of thecomponents, processing steps, and display screens are not intended tolimit the scope of the present disclosure unless otherwise specified.

(System Configuration)

FIG. 1 illustrates a configuration example of a system according to anexemplary embodiment. For example, this system is a wirelesscommunication system where a plurality of communication apparatuses canwirelessly communicate with each other. In the example of FIG. 1 , thesystem includes a portable communication terminal apparatus 200, amultifunction peripheral (MFP) 300, and an access point 400 as thecommunication apparatuses. The portable communication terminal apparatus200 may be referred to simply as a terminal apparatus 200.

The terminal apparatus 200 is a terminal apparatus (informationprocessing apparatus) having wireless communication functions using awireless local area network (LAN) and Bluetooth®. The wireless LAN mayhereinafter be referred to as a WLAN. The terminal apparatus 200 can bea personal information terminal, such as a personal digital assistant(PDA), a mobile phone, or a digital camera. The MFP 300 is a printingapparatus having a print function. The MFP 300 may further include areading function (scanner), a facsimile (FAX) function, and a telephonefunction. The MFP 300 according to the present exemplary embodiment hasa communication function capable of wireless communication with theterminal apparatus 200. The present exemplary embodiment describes acase of using the MFP 300 as an example. However, this is notrestrictive. For example, a FAX apparatus, a scanner apparatus, aprojector, a mobile terminal, a smartphone, a laptop personal computer(PC), a tablet terminal, a PDA, a digital camera, a music player device,and a television set each having communication functions may be usedinstead of the MFP 300. The access point 400 is provided separate from(outside) the terminal apparatus 200 and the MFP 300, and operates as aWLAN base station apparatus. The access point 400 may be referred to asan external access point 400 or an external wireless base station (orexternal master station). Communication apparatuses having a WLANcommunication function can communicate in a WLAN infrastructure mode viathe access point 400. An access point may hereinafter be referred to asan “AP”. The infrastructure mode may be referred to as a “wirelessinfrastructure mode”. The access point 400 performs wirelesscommunication with a communication apparatus permitted (authenticated)to connect to the own apparatus, and relays wireless communicationbetween the communication apparatus and another communication apparatus.The access point 400 is connected to a wired communication network, forexample, and can relay communication between a communication apparatusconnected to the wired communication network and another communicationapparatus wirelessly connected to the access point 400.

The terminal apparatus 200 and the MFP 300 can perform wirelesscommunication in the wireless infrastructure mode via the externalaccess point 400 and in a peer-to-peer mode without the intervention ofthe external access point 400 by using their WLAN communicationfunctions. Peer-to-peer will hereinafter be referred to as “P2P”. P2Pmodes include a Wi-Fi Direct (registered trademark) mode and a softwareAP mode. The Wi-Fi Direct (registered trademark) may hereinafter bereferred to as WFD. The terminal apparatus 200 and the MFP 300 mayperform P2P communication by using a Bluetooth® communication function.For the sake of distinction, P2P using the WLAN communication functionand P2P using the Bluetooth® communication function may be referred toas P2P (WLAN) and P2P (Bluetooth®), respectively. In other words, P2P(WLAN) can be said to be communication compliant with the Institute ofElectrical and Electronics Engineers (IEEE) 802.11 series. In thepresent exemplary embodiment, as will be described below, the terminalapparatus 200 and the MFP 300 can perform processing corresponding to aplurality of print services by using WLAN communication.

(External Configuration of Terminal Apparatus)

FIG. 2 is a diagram illustrating an example of an external configurationof the terminal apparatus 200. In the present exemplary embodiment, theterminal apparatus 200 will be described to be an average smartphone,for example. The terminal apparatus 200 includes a display unit 202, anoperation unit 203, and a power key 204, for example. An example of thedisplay unit 202 is a display including a display mechanism of liquidcrystal display (LCD) type. Alternatively, the display unit 202 maydisplay information by using light-emitting diodes (LEDs), for example.The terminal apparatus 200 may have a function of outputting informationusing sound in addition to or instead of the display unit 202. Theoperation unit 203 includes hardware keys, such as a key and a button,and/or a touch panel for detecting user operations. Since, in thepresent exemplary embodiment, information display by the display unit202 and acceptance of user operations by the operation unit 203 areperformed using a common touch panel display, the display unit 202 andthe operation unit 203 are implemented by a single device. In such acase, for example, button icons and a software keyboard are displayed bythe display function of the display unit 202, and a user's touch on sucha portion is detected by the operation acceptance function of theoperation unit 203. Alternatively, the display unit 202 and theoperation unit 203 may be separated to provide a piece of hardware fordisplay and a piece of hardware for operation acceptance separately. Thepower key 204 is a hardware key for accepting a user operation forpowering on/off the terminal apparatus 200.

The terminal apparatus 200 includes a WLAN unit 201 for providing theWLAN communication function, which is not necessarily visible fromoutside. The WLAN unit 201 is configured to be capable of data (packet)communication in a WLAN system compliant with the IEEE 802.11 standardseries (such as IEEE 802.11a/b/g/n/ac/ax), for example. However, this isnot restrictive, and the WLAN unit 201 may be capable of communicationin a WLAN system compliant with other standards. In the present example,the WLAN unit 201 can communicate in both 2.4- and 5-GHz frequencybands. The WLAN unit 201 can perform WDF-based communication,communication in the software AP mode, and communication in the wirelessinfrastructure mode. Operations in such modes will be described below.The terminal apparatus 200 further includes a Bluetooth® unit (notillustrated), which is not visible from outside. The Bluetooth® unit iscompliant with the IEEE 802.15.1 standard, and provides 2.4-GHzcommunication functions used in Bluetooth® 1.1 to 5.0, such asBluetooth® Basic Rate/Enhanced Data Rate (BR/EDR), Bluetooth®+High Speed(HS), and Bluetooth® Low Energy. Bluetooth® operations will be describedbelow.

(External Configuration of MFP)

FIG. 3 illustrates an example of an external configuration of the MFP300. For example, the MFP 300 includes a document platen 301, a documentlid 302, a print sheet insertion port 303, a print sheet discharge port304, and an operation display unit 305. The document platen 301 is aplaten on which a document to be read is placed. The document lid 302 isa lid for holding down the document placed on the document platen 301and preventing light from a light source for irradiating the documentduring reading from leaking outside. The print sheet insertion port 303is an insertion port where various sizes of sheets can be set. The printsheet discharge port 304 is a discharge port for discharging a printedsheet. Sheets set in the print sheet insertion port 303 are conveyed toa printing unit one by one, printed on the printing unit, and thendischarged from the print sheet discharge port 304. The operationdisplay unit 305 includes keys, such as character input keys, cursorkeys, an OK key, and a cancel key, LEDs, and an LCD. The operationdisplay unit 305 is configured to be capable of accepting user'soperations for activating various functions of the MFP 300 andperforming various settings. The operation display unit 305 may includea touch panel display. The MFP 300 has WLAN and Bluetooth® wirelesscommunication functions, and includes a wireless communication antenna306 for wireless communication, which is not necessarily visible fromoutside. Like the terminal apparatus 200, the MFP 300 can also performwireless communication in 2.4- and 5-GHz frequency bands using a WLANand Bluetooth®.

FIGS. 4A to 4C schematically illustrate examples of screen display onthe operation display unit 305 of the MFP 300. FIG. 4A illustrates anexample of a home screen that is displayed in a state where the MFP 300is powered on and any operation, such as print and scan operations, isnot performed (idle state, standby state). In a case where a menudisplay item of a copy function, a scan function, or a cloud functionusing the Internet communication is selected by a key operation or atouch panel operation, the MFP 300 can start to perform thecorresponding setting or function. By accepting key operations or touchpanel operations on the home screen of FIG. 4A, the MFP 300 can displayscreens different from the home screen of FIG. 4A in a seamless mannerFIG. 4B illustrates an example of such a screen, where menu items forperforming a print function, performing a photo function, and changingcommunication settings are displayed. The print and photo functions canbe performed and the communication settings can be performed based onuser selections on this screen. FIG. 4C illustrates an example of aninterface (I/F) selection screen that is displayed in a case where amenu item for changing communication setting is selected on the screenof FIG. 4B. On this screen, various LAN setting menu items (“wired LAN”,“wireless LAN”, and “wireless direct”) for performing a wired connectionsetting, an on/off setting of the wireless infrastructure mode, andon/off settings of the P2P modes, such as the WFD and software AP modes,are displayed in a selectable manner. In a case where the wireless LANis set to on by a user operation in FIG. 4C, the wireless infrastructuremode is enabled. In a case where the wireless direct is set to on by auser operation, the P2P (WLAN) mode is enabled. This screen alsodisplays a setting menu item (“Bluetooth®”) intended for Bluetooth®setting, such as a Bluetooth® on/off setting, in a selectable manner.The screen further displays a common setting menu item related tovarious connection modes. The user can also set the frequency band andfrequency channel of the wireless LAN and a Bluetooth® pairing code onthis screen.

(Configuration of Terminal Apparatus)

FIG. 5 illustrates a configuration example of the terminal apparatus200. For example, the terminal apparatus 200 includes a main board 501that performs main control on the own apparatus, the WLAN unit 201 thatperforms WLAN communication, and a Bluetooth® unit 205 that performsBluetooth® communication. The main board 501 includes a centralprocessing unit (CPU) 502, a read-only memory (ROM) 503, a random accessmemory (RAM) 504, an image memory 505, a data conversion unit 506, atelephone unit 507, a Global Positioning System (GPS) unit 509, a cameraunit 511, a nonvolatile memory 512, a data storage unit 513, a speakerunit 514, and a power supply unit 515. Here, the terminal apparatus 200includes the display unit 202 and the operation unit 203. Suchfunctional units in the main board 501 are connected to each other via asystem bus 518 managed by the CPU 502. The main board 501, the WLAN unit201, and the Bluetooth® unit 205 are connected via dedicated buses 516,for example.

The CPU 502 is a system control unit and controls the entire terminalapparatus 200. The processing of the terminal apparatus 200 to bedescribed below is implemented, for example, by the CPU 502 executing aprogram stored in the ROM 503. Pieces of hardware dedicated forrespective processes may be provided. The ROM 503 stores controlprograms and a built-in operating system (OS) program that are executedby the CPU 502. In the present exemplary embodiment, the CPU 502performs software control, such as scheduling and task switching, byexecuting the control programs stored in the ROM 503 under themanagement of the built-in OS that is similarly stored in the ROM 503.The RAM 504 includes a static RAM (SRAM). The RAM 504 stores data, suchas program control variables, and data, such as setting valuesregistered by the user, and management data on the terminal apparatus200. The RAM 504 can also be used as various work buffers. The imagememory 505 includes a memory, such as a dynamic RAM (DRAM). The imagememory 505 temporarily stores image data received via the WLAN unit 201and/or the Bluetooth® unit 205 and image data read from the data storageunit 513 for the sake of processing by the CPU 502. The nonvolatilememory 512 includes a memory, such as a flash memory, for example. Thenonvolatile memory 512 retains data even after the terminal apparatus200 is powered off. The memory configuration of the terminal apparatus200 is not limited to the foregoing. For example, the image memory 505and the RAM 504 may be shared. The data storage unit 513 may be used fordata backup. In the present exemplary embodiment, a DRAM is described asan example of the image memory 505. However, other recording media, suchas a hard disk and a nonvolatile memory, may be used.

The data conversion unit 506 analyzes data of various formats, andperforms data conversion, such as color conversion and image conversion.The telephone unit 507 implements telephone communication by controllinga telephone line and processing voice data input and output via thespeaker unit 514. The GPS unit 509 receives radio waves transmitted fromsatellites to obtain position information, such as the current latitudeand longitude of the terminal apparatus 200. The camera unit 511 has afunction of electrically recording and encoding an image input via alens. Image data captured by the camera unit 511 is stored into the datastorage unit 513. The speaker unit 514 performs control to implement afunction of inputting and outputting voice for the telephone function,and other functions including an alarm notification function. The powersupply unit 515 is a portable battery, for example, and performs powersupply control inside the terminal apparatus 200. Examples of a powersupply state include a dead battery state where the remaining batterylevel is zero, a power-off state where the power key 204 is not pressed,an activated state where the terminal apparatus 200 is normallyactivated, and a power saving state where the terminal apparatus 200 isactivated but with saved power. The display unit 202 refers to thedisplay unit 202 described with reference to FIG. 2 . The display unit202 electrically controls its display contents to control display ofvarious input operations as well as the operation state and statusinformation (such as the remaining ink level and the remaining amount ofsheets) of the MFP 300. The operation unit 203 refers to the operationunit 203 described with reference to FIG. 2 . The operation unit 203performs control to accept user operations, generate electrical signalscorresponding to the operations, and output the electrical signals tothe CPU 502.

The terminal apparatus 200 performs wireless communication using theWLAN unit 201 and the Bluetooth® unit 205, to perform data communicationwith other devices, such as the MFP 300. The WLAN unit 201 and theBluetooth® unit 205 convert data into packets and transmit the packetsto other devices. The WLAN unit 201 and the Bluetooth® unit 205reconstruct original data from packets transmitted from other devicesoutside, and output the original data to the CPU 502. The WLAN unit 201and the Bluetooth® unit 205 are units for implementing communicationcompliant with the WLAN and Bluetooth® standards, respectively. The WLANunit 201 can operate in at least two communication modes including thewireless infrastructure mode and the P2P (WLAN) mode in parallel. TheBluetooth® unit 205 can operate in a communication mode compliant withBluetooth® 1.1 to 5.0, for example. The frequency bands in suchcommunication modes can be limited by the functionality and performanceof the hardware.

(Configuration of MFP)

FIG. 6 illustrates a configuration example of the MFP 300. The MFP 300includes a main board 601 that performs main control on the ownapparatus, and a wireless combination unit 616 that is a singlecommunication module for performing WLAN communication and Bluetooth®communication using at least one common antenna. The MFP 300 alsoincludes a modem 619 for performing wired communication, for example.The main board 601 includes, for example, a CPU 602, a ROM 603, a RAM604, a nonvolatile memory 605, an image memory 606, a read control unit607, a data conversion unit 608, a reading unit 609, and a coding anddecoding processing unit 611. The main board 601 also includes aprinting unit 612, a sheet feed unit 613, a print control unit 614, andthe operation display unit 305, for example. Such functional units inthe main board 601 are connected to each other via a system bus 620managed by the CPU 602. The main board 601 and the wireless combinationunit 616 are connected via a dedicated bus 615, for example. The mainboard 601 and the modem 619 are connected via a bus 618, for example.

The CPU 602 is a system control unit and controls the entire MFP 300. Asan example, the processing of the MFP 300 to be described below isimplemented by the CPU 602 executing a program stored in the ROM 603.Pieces of hardware dedicated for respective processes may be provided.The ROM 603 stores control programs and a built-in OS program that areexecuted by the CPU 602. In the present exemplary embodiment, the CPU602 performs software control such as scheduling and task switching byexecuting the control programs stored in the ROM 603 under themanagement of the built-in OS that is similarly stored in the ROM 603.The RAM 604 includes an SRAM. The RAM 604 stores data such as programcontrol variables, and data such as setting values registered by theuser and management data on the MFP 300. The RAM 604 can also be used asvarious work buffers. The nonvolatile memory 605 includes a memory, suchas a flash memory, for example. The nonvolatile memory 605 retains dataeven after the MFP 300 is power off. The image memory 606 includes amemory such as a DRAM. The image memory 606 stores image data receivedvia the wireless combination unit 616 and image data processed by thecoding and decoding processing unit 611. Like the terminal apparatus200, the memory configuration of the MFP 300 is not limited to theforegoing. The data conversion unit 608 analyzes data of various formatsand converts image data into print data.

The read control unit 607 controls the reading unit 609 (for example, acontact image sensor (CIS)) to optically read a document placed on thedocument platen 301. The read control unit 607 converts an imageobtained by optically reading the document into electrical image data(image signal), and outputs the image data. The read control unit 607here may apply various types of image processing, such as binarizationprocessing and halftone processing, before outputting the image data.The operation display unit 305 refers to the operation display unit 305described with reference to FIGS. 4A to 4C. The operation display unit305 performs display control as well as generation control on electricsignals corresponding to user operations.

The coding and decoding processing unit 611 performs coding processingand decoding processing on image data (such as Joint PhotographicExperts Group (JPEG) data and Portable Network Graphics (PNG) data) thatis handle by the MFP 300, and enlargement and reduction processing. Thesheet feed unit 613 stores sheets for printing. The sheet feed unit 613can supply set sheets under the control of the print control unit 614.The sheet feed unit 613 may include a plurality of sheet feed units tostore a plurality of types of sheets in one apparatus. Which of thesheet feed units to feed sheets can be controlled under the control ofthe print control unit 614. The print control unit 614 applies varioustypes of image processing, including smoothing processing, print densitycorrection processing, and color correction, to the image data to beprinted, and outputs the processed image data to the printing unit 612.The printing unit 612 is configured to be capable of performing inkjetprint processing, for example. The printing unit 612 records an image ona recording medium, such as a sheet, by discharging ink supplied from anink tank out of its print head. The printing unit 612 may be configuredto be capable of performing other print processing, such aselectrophotographic print processing. The print control unit 614 canread information about the printing unit 612 on a regular basis, andupdate status information stored in the RAM 604, including the remainingink level of the ink tank and the state of the print head.

The wireless combination unit 616 is a unit that can provide the WLANand Bluetooth® wireless functions. For example, the wireless combinationunit 616 can provide functions similar to those of the combination ofthe WLAN unit 201 and the Bluetooth® unit 205 of the terminal apparatus200. More specifically, the wireless combination unit 616 converts datainto packets, transmits the packets to other devices, reconstructsoriginal data from packets from the other devices outside, and outputsthe original data to the CPU 602, based on the WLAN and Bluetooth®standards. The terminal apparatus 200 and the MFP 300 can perform P2P(WLAN) communication based on WFD, and the wireless combination unit 616has a software access point (software AP) function or a group ownerfunction. In other words, the wireless combination unit 616 canconstruct a P2P communication network and determine a channel to be usedfor the P2P communication.

(P2P Communication Method)

Next, a P2P (WLAN) communication method by which the apparatusesdirectly wirelessly communicate by WLAN communication without anintervention of the external access point 400 will be overviewed. P2P(WLAN) communication can be implemented by a plurality of techniques.For example, the communication apparatuses can support a plurality ofmodes for P2P (WLAN) communication, and perform P2P (WLAN) communicationby selectively using one of the plurality of modes.

In each mode, a searching communication apparatus searches for anddiscovers a to-be-searched communication apparatus (partner apparatus)by using a search signal for searching for a partner apparatus (such asa Probe Request frame and a beacon). In searching for the partnerapparatus, the searching communication apparatus and the to-be-searchedcommunication apparatus use the same frequency band and the samecommunication method. For example, a description will be given of a casewhere the communication apparatuses can perform communication in (1) theP2P (WLAN) mode in the 2.4-GHz frequency band, (2) the P2P (Bluetooth®)mode in the 2.4-GHz frequency band, and (3) the P2P (WLAN) mode in the5-GHz frequency band. The user can set the MFP 300 to operate in adesired one of the P2P modes. For example, in a case where the user setsthe MFP 300 to operate in the P2P (WLAN) mode in the 2.4-GHz frequencyband, the MFP 300 is unable to receive a search signal in the 5-GHz bandif the searching communication apparatus such as the terminal apparatus200 transmits a search signal in the 5-GHz band. Thus, the MFP 300 willnot transmit a response signal for the search signal. For example, in acase where the user sets the MFP 300 to operate in the P2P (Bluetooth®)mode in the 2.4-GHz band and disables the P2P (WLAN) mode in the 2.4-GHzband, the MFP 300 is unable to recognize a search signal if thesearching communication apparatus such as the terminal apparatus 200transmits a search signal that is in the same 2.4-GHz band but is a WLANsearch signal. Thus, the MFP 300 will not transmit a response signal.The searching communication apparatus can discover a to-be-searchedpartner apparatus that uses the same frequency band and the samecommunication method in such a manner.

There are four possible P2P modes:

Mode A (software AP mode)

Mode B (Wi-Fi Direct (WFD) mode)

Mode D (Bluetooth® Low Energy mode)

Mode E (Bluetooth® Classic mode)

Communication apparatuses capable of P2P communication can be configuredto support at least one of the modes. In the present exemplaryembodiment, mode A and mode B may be referred to collectively as P2P(WLAN), and mode D and mode E as P2P (Bluetooth®). Communicationapparatuses capable of P2P communication do not necessarily support allthe modes and may be configured to support only some of the modes. Thecommunication apparatuses can also support the wireless infrastructuremode (mode C) aside from the P2P modes.

A communication apparatus having the WFD and Bluetooth® communicationfunctions (such as the terminal apparatus 200) accepts user operationsvia its operation unit and calls an application (in some cases,dedicated one) for implementing the communication functions. Thecommunication apparatus then displays a screen provided by theapplication to prompt user operations, and implements WFD communicationand Bluetooth® communication based on the user operations accepted. Asemployed here, Bluetooth® communication refers to communication usingBluetooth® 1.1 to 5.0, such as Bluetooth® Classic and Bluetooth® LowEnergy.

Next, sequences (device search sequences) for searching a partnerapparatus in the foregoing four P2P modes will be described.

Device Search Sequence in Mode A (Software AP Mode)

FIG. 7 illustrates the device search sequence in mode A (software APmode). In the software AP mode, a communication apparatus (for example,the terminal apparatus 200) operates as a client that requests variousservices. The other communication apparatus (for example, the MFP 300)operates as a software AP that can perform the WLAN AP function based onsoftware settings. In the software AP mode, the communication apparatusoperating as the client transmits a device search request 701 to searchfor the communication apparatus operating as the software AP. Thesoftware AP receives the device search request 701, and transmits adevice search response 702 as a response. The communication apparatus(for example, terminal apparatus 200) operating as the client discoversthe partner apparatus (for example, MFP 300) operating as the softwareAP, by the transmission and reception of a device search request and adevice search response like this. Since the commands and parameterstransmitted and received in establishing the wireless connection betweenthe client and the software AP can be those defined in the Wi-Fi(registered trademark) standard, a description thereof will be omittedhere. As a master station, the MFP 300 operating in the software AP modedetermines the frequency band and the frequency channel. The MFP 300 canthus select which frequency band to use, the 5-GHz band or the 2.4-GHzband, and which frequency channel to use in the selected frequency band.

Device Search Sequence in Mode B (WFD Mode)

FIG. 8 illustrates the device search sequence in mode B (WFD mode). Inthe WFD mode, the searching communication apparatus searches for theto-be-searched partner apparatus by transmitting a device search request801. In the present exemplary embodiment, the searching communicationapparatus is the terminal apparatus 200 and the to-be-searched partnerapparatus is the MFP 300. The device search request 801 has a WFDattribute, whereby the search target is specified to be a communicationapparatus in the WFD mode. In a case where the MFP 300 operating in theWFD mode receives the device search request 801, the MFP 300 transmits adevice search response 802 to the terminal apparatus 200 as a response.In case where the terminal apparatus 200 receives the device searchresponse 802, the terminal apparatus 200 detects the MFP 300 that is theP2P communication partner. After the completion of the device search,the communication apparatuses determine the roles of the P2P group owner(GO) and the P2P client, and perform the rest of the wireless connectionprocessing. The role determination corresponds to GO Negotiation in WFD.The MFP 300 may be activated as a master station in the WFD mode in afixed manner (Autonomous Group Owner). In such a case, the GONegotiation processing for determining the roles is not needed.Moreover, in such a case, the MFP 300 determines, as the master station,the frequency band and the frequency channel. The MFP 300 can thusselect which frequency band to use, the 5-GHz band or the 2.4-GHz band,and which frequency channel to use in the frequency band.

Device Search Sequence in Mode D (Bluetooth® Low Energy Mode)

FIG. 10 illustrates the device search sequence in mode D (Bluetooth® LowEnergy mode). In the Bluetooth® Low Energy mode, a communicationapparatus transmits (broadcasts) a beacon 1001 (Advertising data (suchas an Advertising protocol data unit (PDU))). The other communicationapparatus can recognize the presence of the communication apparatus byreceiving the beacon 1001. For example, in a case where the MFP 300transmits the beacon 1001, the terminal apparatus 200 can recognize thepresence of the MFP 300 by receiving the beacon 1001. To obtainadditional information after the reception of the beacon 1001, theterminal apparatus 200 transmits a scan request to the MFP 300. The MFP300 can transmit a scan response in response to the scan request. TheMFP 300 and the terminal apparatus 200 can communicate in the Bluetooth®Low Energy based P2P (Bluetooth®) mode by using the Generic AttributeProfile (GATT). Since the commands and parameters for communication canbe those defined in Bluetooth® 4.1 standard, a description thereof willbe omitted here. In FIG. 10 , the MFP 300 operates as a slave, and theterminal apparatus 200 as a master.

Device Search Sequence in Mode E (Bluetooth® Mode)

FIG. 11 illustrates the device search sequence in mode E (Bluetooth®mode). In the Bluetooth® mode, one communication apparatus operates as amaster for searching for a Bluetooth® device, and the othercommunication apparatus as a slave. In the present exemplary embodiment,for example, the terminal apparatus 200 operates as a master here, andthe MFP 300 operates as a slave. The terminal apparatus 200 (master)searches for the partner apparatus by transmitting a device searchrequest 1101. In a case where the MFP 300 (slave) receives the devicesearch request 1101, the MFP 300 transmits a device search response 1102as a response signal. Since the connection and transmission/receptionprocedures using the commands and parameters including the device searchrequest 1101 and the device search response 1102 are defined in theBluetooth® 1.1 standard and its variations, a description thereof willbe omitted here.

(Wireless Infrastructure Mode)

FIG. 9 is a diagram illustrating a device search sequence in mode C(wireless infrastructure mode). In the wireless infrastructure mode,communication apparatuses to communicate with each other (for example,the terminal apparatus 200 and the MFP 300) are connected to an externalAP governing a network (for example, the access point 400), and thecommunication apparatuses communicate with each other via the AP. Inother words, the communication apparatuses communicate via the networkconstructed by the external AP. In the wireless infrastructure mode, forexample, the terminal apparatus 200 searches for the access point 400 bytransmitting a device search request (Probe Request) 901. The accesspoint 400 transmits a device search response (Probe Response) 902 inresponse to the device search request 901. The terminal apparatus 200discovers the access point 400 by receiving the device search response902, and displays a service set identifier (SSID) included in the ProbeResponse. Similarly, the MFP 300 also discovers the access point 400 bytransmitting a device search request 903 and receiving a device searchresponse 904, and displays the SSID included in the Probe Response. Theterminal apparatus 200 and the MFP 300 each discover the access point400, transmit a connection request to the access point 400, and connectto the access point 400, whereby the communication between thecommunication apparatuses in the wireless infrastructure mode via theaccess point 400 is enabled. Alternatively, the plurality ofcommunication apparatuses may connect to respective different APs. Insuch a case, the communication between the communication apparatuses isenabled by data transfer between the APs. Since the commands andparameters transmitted and received in performing communication betweenthe communication apparatuses via the access point(s) can be thosedefined in the Wi-Fi standards, a description thereof will be omittedhere. In the wireless infrastructure mode, the access point 400determines the frequency band and the frequency channel. The accesspoint 400 can thus select which frequency band to use, the 5-GHz band orthe 2.4-GHz band, and which frequency channel to use in the frequencyband.

(Summary of Processing)

In a case where a communication apparatus operates in a plurality ofwireless communication modes in parallel, convenience can be decreased.For example, in a case where a CPU and a set of antennas are used toenable connections in a plurality of wireless communication modes inparallel, convenience can be decreased due to insufficient communicationtimes in the wireless communication modes used for data communication. Aset of antennas may refer to, for example, a single antenna or a set ofarray antennas. In a case where, for example, the MFP 300 including thewireless combination unit 616 as described above operates in a pluralityof communication modes such as the wireless infrastructure mode and theP2P (WLAN) mode in parallel, communication intervals and communicationspeeds can thus be unstable depending on the operation state. In thepresent exemplary embodiment, the wireless combination unit 616 of theMFP 300 will be described to include a single antenna. Thecommunications in the wireless infrastructure mode, the P2P (WLAN) mode,and the P2P (Bluetooth®) mode are performed by using the single antenna.Note that performing communications in such communication modes using asingle antenna is just an example. A plurality of antennas may be used,and communication modes different from the foregoing may be performed.All the three modes do not need to be performed, either.

In the present exemplary embodiment, processing for increasing thecommunication stability in the case where a communication apparatus isset to use a plurality of wireless communication modes in parallel isperformed. Specifically, in a case where a plurality of wirelesscommunication modes is enabled, the MFP 300 according to the presentexemplary embodiment controls operation in a time division manner. TheMFP 300 then performs control to change ratios of durations ofcommunication using the respective wireless communication modes per unittime, based on connection states in the plurality of wirelesscommunication modes enabled. Time division control based on theconnection states will now be described. The user can individuallyenable the WLAN wireless infrastructure mode, the P2P (WLAN) mode, andthe Bluetooth® Low Energy mode by using the screen of FIG. 4C, forexample. Based on such operations, the MFP 300 can maintain the wirelessconnection in the wireless infrastructure mode for enabling wirelesscommunication with the communication partner apparatus via the externalaccess point 400 and the P2P (WLAN) mode without the intervention of theexternal access point 400 in parallel. During the communication in theP2P (WLAN) mode according to the present exemplary embodiment, the MFP300 itself functions as a master station.

(Time Division Control Based on Connection States)

The wireless combination unit 616 of the MFP 300 is capable of, forexample, WLAN communication compliant with the IEEE 802.11 standardseries in the 2.4- and 5-GHz bands, and also capable of communicationcompliant with the Bluetooth® Low Energy standard of Bluetooth® 4.1 orlater. Examples of possible WLAN connection states of the MFP 300 usingthe wireless combination unit 616 include a “standby state”, a “wirelessinfrastructure connection state”, a “P2P connection state”, and a“wireless infrastructure connection and P2P connection state”.

The “standby state” refers to a state where the MFP 300 is powered on,the wireless infrastructure mode and the P2P (WLAN) mode are enabled,and a connection request can be accepted. In this state, however, theMFP 300 is not actually performing connection processing with anexternal AP (for example, the access point 400) or an external apparatus(for example, the terminal apparatus 200). In other words, the “standbystate” refers to a state where a plurality of communication modes isenabled and the communication partner apparatuses in the respectivecommunication modes are yet to be determined.

The “wireless infrastructure connection state” refers to a state wherethe MFP 300 is powered on, the wireless infrastructure mode and the P2P(WLAN) mode are enabled, and the external access point 400 is set as aconnection partner. In this mode, however, the communication partnerapparatus in the P2P (WLAN) mode is yet to be determined. The “P2Pconnection state” refers to a state where the MFP 300 is powered on, thewireless infrastructure mode and the P2P (WLAN) mode are enabled, andthe connection processing with the terminal apparatus 200 that is theconnection partner in the P2P (WLAN) mode is completed. In this mode,however, the connection partner apparatus in the wireless infrastructuremode is yet to be determined. The “wireless infrastructure connectionand P2P connection state” refers to a state where both the wirelesscommunication modes are enabled and both the connection partnerapparatuses are determined.

The MFP 300 performs data communication by wireless communication in theWLAN wireless infrastructure mode or wireless communication in the P2P(WLAN) mode, using the wireless combination unit 616. The MFP 300 canenable the WLAN wireless infrastructure mode and the P2P (WLAN) mode inparallel. The CPU 602 determines which of the two modes, the wirelessinfrastructure mode or the P2P (WLAN) mode, uses more wireless resourcesin the data communication, based on the connection states (for example,presence or absence of the communication partner apparatuses). Based onthe determination, the CPU 602 then determines durations to be assignedto the respective modes per unit time.

<Startup Settings>

The MFP 300 is configured to start a processing sequence that isdedicated for initial activation time (initial setup) and different fromusual to perform initial settings in a factory shipment state (deliverystate), when the user powers on the MFP 300 for the first time afterpurchase. For example, the MFP 300 is shipped from the factory withoutan ink tank or a print head attached to the printing unit 612.Immediately after the initial activation which is the initial operationby the user, the MFP 300 thus executes preparatory operations, such asprompting the user to attach an accompanying ink tank and print head, tomake the MFP 300 usable. Whether the MFP 300 is still in the factoryshipment state, i.e., an initial activation state, is determined byusing a flag (initial activation flag) stored in the nonvolatile memory605. The state of the initial activation flag is changed by thecompletion of the preparatory operations. After the completion of thepreparatory operations, the MFP 300 controls the processing sequencededicated for the initial activation time to not be activated.

In the present exemplary embodiment, taking it into account thatspecific processing is performed upon the initial activation of the MFP300, communication modes are set during the processing upon the initialactivation. The processing for setting the communication modes upon theinitial activation of the MFP 300 will be described with reference toFIGS. 12 and 13 . While initial setup sequences other than the settingof the communication modes are also performed upon the initialactivation, a description of the sequences not directly related to thepresent exemplary embodiment will be omitted here. The processingprocedure performed by the MFP 300 will be described with reference tothe flowchart of FIG. 13 . The processing of the steps in the flowchartaccording to the present exemplary embodiment is implemented, forexample, by the CPU 602 reading a program stored in the ROM 603 andexecuting the program.

In step S1301, the MFP 300 powered on refers to the initial activationflag stored in the nonvolatile memory 605, and determines whether theown apparatus is in the initial activation state. When the MFP 300 isshipped from the factory, the initial activation flag is set to aspecific value indicating the initial activation state. In a case wherethe MFP 300 determines that the own apparatus is not in the initialactivation state (NO in step S1301), the processing proceeds to stepS1313. In step S1313, the MFP 300 enables an I/F (also referred to as acommunication mode) set to be enabled, based on settings stored in thenonvolatile memory 605. In step S1314, the MFP 300 displays a normalactivation time standby screen like the screen illustrated in FIG. 4A,and enters a state of waiting for user operations. Then, the processingends. The processing of steps S1313 and S1314 corresponds to activationprocessing for normal use of the MFP 300. The normal use corresponds tothe state the case where the MFP 300 is used after the completion of theinitial setup. On the other hand, In a case where the MFP 300 determinesthat the own apparatus is in the initial activation state (YES in stepS1301), the processing proceeds to step S1302 to perform a processingsequence for the case where the user activates the MFP 300 for the firsttime, illustrated in steps S1302 to S1315. In this processing sequence,in step S1302, the MFP 300 initially displays a screen for prompting theuser to select an I/F to be used on the MFP 300, such as illustrated inFIG. 12 , on the operation display unit 305. The user selects the I/F tobe used on the MFP 300 from among the items displayed on the screen. Instep S1303, the MFP 300 determines whether “wireless LAN” is selected bya user operation. In a case where the MFP 300 determines that “wirelessLAN” is not selected (NO in step S1303), the processing proceeds to stepS1311. In step S1311, the MFP 300 determines whether “wired LAN” isselected by a user operation. In a case where the MFP 300 determinesthat “wired LAN” is selected (YES in step in step S1311), the processingproceeds to step S1312. In step S1312, the MFP 300 performs processingfor enabling a wired LAN I/F. The processing proceeds to step S1315. Inaddition, the MFP 300 stores setting information indicating that thewired LAN I/F is enabled into the nonvolatile memory 605. This enablesthe MFP 300, when normally activated (NO in step S1301), to refer to thesetting information and enable the wired LAN I/F (step S1313). In a casewhere the MFP 300 determines that “wired LAN” is not selected, either(NO in step S1311), the processing proceeds to step S1315. The casewhere the processing proceeds from step S1311 to step S1315 withoutperforming the processing of step S1312 refers to where “USB” (UniversalSerial Bus) is selected, not “wireless LAN” or “wired LAN”. In such acase, in step S1315, the MFP 300 enables a USB I/F, and ends the I/Fsetting processing upon the initial activation. Although not illustratedin the diagram, when delivery processing sequences including the I/Fselection are all completed, the MFP 300 changes the value of theinitial activation flag stored in the nonvolatile memory 605 from thevalue indicating the initial activation state to a value indicating anon-initial activation state. The non-initial activation statecorresponds to the state during the normal use described above. Thisprevents the initial activation processing sequence from being activatedwhen the MFP 300 is powered on at next timing.

Return to step S1303. In a case where the MFP 300 determines that“wireless LAN” is selected by a user operation (YES in step S1303), theprocessing proceeds to step S1304. In step S1304, the MFP 300 activatesa cableless setup mode. The cableless setup mode is a mode dedicated forwireless settings. In the cableless setup mode, the MFP 300 activatesthe wireless combination unit 616 in the software AP mode and operatesthe wireless combination unit 616 as a master station. The software APactivated at this timing is a master station intended for the cablelesssetup mode. External communication apparatuses, such as a PC, asmartphone, and a tablet, can thus connect to and communicate with theMFP 300 as clients (slave units). During the cableless setup, either the2.4- or 5-GHz frequency band is used. Which of the frequency bands touse may be determined, for example, by the MFP 300, based on wirelesscommunication conditions nearby. For example, in a case where the MFP300 determines that wireless communication using the 2.4-GHz band ismore congested than wireless communication using the 5-GHz band, the MFP300 may operate the wireless combination unit 616 as a software AP forperforming communication using the 5-GHz band. The cableless setup modeis not limited to the use of the software AP mode. For example, the WFDmode may be used instead of the software AP mode. The software AP modeis used here because the use of WFD involves including a randomlygenerated character string into the SSID, the network identifier, whilethe software AP is free from such a restriction. In the presentexemplary embodiment, the terminal apparatus 200 establishes a P2P(WLAN) wireless connection compliant with the IEEE 802.11 series withthe wireless combination unit 616 of the MFP 300 activated as a softwareAP in step S1304.

In the cableless setup mode, in step S1305, the MFP 300 accepts input ofsetting information mainly used to establish a connection in thewireless infrastructure mode. The external communication apparatus, suchas a PC, a smartphone, and a tablet, establishes a P2P (WLAN) wirelessconnection with the wireless combination unit 616 of the MFP 300, andthen transmits setting information for the wireless infrastructure mode.For example, the MFP 300 identifies SSIDs to which the own apparatus canconnect, generates an SSID list, and transmits the SSID list to theexternal communication apparatus via the P2P (WLAN) wireless connection.The external communication apparatus then displays the SSID list byusing a dedicated LAN setting application, and transmits an SSIDselected by the user and a password to be used to connect to the SSID tothe MFP 300 as setting information via the P2P (WLAN) wirelessconnection. The dedicated LAN setting application running on theexternal communication apparatus, such as a PC, a smartphone, and atablet, is configured so that the MFP 300 can be connected to anexternal AP to which the external communication apparatus is connected.The setting information may be input using a different method other thanuser specification. For example, the dedicated LAN setting applicationrunning on the terminal apparatus 200 determines whether wirelesssetting information about the external AP to which the terminalapparatus 200 is connected is included in the received SSID list. In acase where the terminal apparatus 200 determines that the wirelesssetting information is included, the wireless setting information aboutthe external AP to which the terminal apparatus 200 is connected may beautomatically transmitted via the P2P (WLAN) wireless connection withthe wireless combination unit 616 of the MFP 300 operating as thesoftware AP. The dedicated LAN setting application can be activated, forexample, by the external communication apparatus executing a programstored in a storage medium packaged with the product of the MFP 300 ordistributed in a form downloadable over a network. In the presentexemplary embodiment, the setting information for the wirelessinfrastructure mode is described to be accepted in step S1305. However,in step S1305, an instruction to operate in the P2P (WLAN) mode may begiven. In a case where such an instruction is given, the MFP 300 endsthe cableless setup mode as in step S1306 to be described below,terminates the software AP mode intended for the cableless setup mode aswell, and activates a software AP serving as a new master station. Thesoftware AP activated here is the same as that in step S1309. Thus, in acase where the software AP is activated here, the processing of stepS1309 may be omitted.

The setting information that the MFP 300 receives from the externalcommunication apparatus in step S1305 includes the SSID of the externalAP constructing the network to be joined, and a frequency band, anencryption method, and an authentication method used by the external AP.The information about the frequency band can include informationspecifying the 5- or 2.4-GHz band, or a value indicating a wirelesschannel related to the frequency band. In step S1306, in response toreceiving the setting information, the MFP 300 ends the cableless setupmode to terminate the software AP mode. In step S1307, the MFP 300performs processing for enabling the wireless infrastructure mode. Instep S1308, the MFP 300 starts communication in the wirelessinfrastructure mode using setting values, based on the settinginformation received in step S1305, and performs processing forconnecting to the external access point 400. In response to enabling thewireless infrastructure mode, the MFP 300 stores the setting informationinto the nonvolatile memory 605. Specifically, information indicatingthat the wireless infrastructure mode is enabled and the SSID of theexternal AP used in the wireless infrastructure mode are stored. In stepS1309, the MFP 300 enables the setting of the P2P (WLAN) mode. In stepS1309, the MFP 300 activates the wireless combination unit 616 in thesoftware AP mode and operates the wireless combination unit 616 as amaster station (software AP). The software AP activated here uses anSSID different from that of the software AP in the foregoing cablelesssetup mode. The wireless combination unit 616 is not limited to beactivated as a software AP and may be activated as a Wi-Fi Direct groupowner. In response to enabling the P2P (WLAN) mode, the MFP 300 thenstores the settings into the nonvolatile memory 605. Specifically,information indicating that the P2P (WLAN) mode is enabled and thefrequency band and channel (CH) information used in the P2P (WLAN) modeare stored. The P2P (WLAN) mode can also be enabled even in a case wherethe MFP 300 can operate in the wireless infrastructure mode and the P2P(WLAN) mode in parallel and only the wireless infrastructure mode isselected by the user in the setup procedure upon the initial activation.The MFP 300 then can automatically perform a setup so that the MFP 300operates in the wireless infrastructure mode and the P2P (WLAN) mode inparallel. In other words, the processing for enabling the P2P (WLAN)mode and storing the settings may be performed regardless of whether theinstruction to enable the P2P (WLAN) mode is received in step S1305. Insuch a case, the frequency bands and CHs suitable for the region wherethe wireless LAN is used can be stored in the MFP 300 as initial valuesin advance.

As described above, the wireless combination unit 616 performscommunication in a plurality of communication modes by using the commonantenna. To perform stable communication in a plurality of communicationmodes by using the common antenna, the MFP 300 sets the priorities ofthe respective communication modes, and sets the durations to beassigned by time division control based on the priorities. In stepS1310, the MFP 300 sets a wireless control table to set the durations.Details of wireless control table setting processing performed in stepS1310 will be described with reference to FIG. 19 . In step S1310, theMFP 300 performs processing for selecting a table to be used from amongones illustrated in FIGS. 20A, 20B, 20C, and 20D, which are stored inthe nonvolatile memory 605 in advance.

In step S1901, the MFP 300 determines whether both the wirelessinfrastructure mode and the P2P (WLAN) mode are enabled.

In a case where both the wireless infrastructure mode and the P2P (WLAN)mode are determined to not be enabled (NO in step S1901), the processingproceeds to step S1910. In step S1910, the MFP 300 performs clearprocessing on the settings in a wireless control table stored in thenonvolatile memory 605. Then, the processing ends. In the presentexemplary embodiment, in a case where the determination of step S1303 isYES, both the wireless infrastructure mode and the P2P (WLAN) mode areenabled in steps S1307 and S1309. On the other hand, in a case where thedetermination of step S1303 is NO, both the wireless infrastructure modeand the P2P (WLAN) mode are disabled. In the present exemplaryembodiment, the state of the MFP 300 in making the determination of stepS1901 is basically either that both the wireless infrastructure mode andthe P2P (WLAN) mode are enabled or that both are disabled. In such acase, the clear processing of step S1910 works fine. By contrast, in acase where either one of the wireless infrastructure mode and the P2P(WLAN) mode is enabled, then in step S1910, the MFP 300 may set theoccupancy of the enabled mode to 100%.

In a case where the MFP 300 determines that both the wirelessinfrastructure mode and the P2P (WLAN) mode are enabled (YES in stepS1901), the processing proceeds to step S1902. In step S1902, the MFP300 determines whether any external access point is connected. Forexample, the MFP 300 performs connection processing with an externalaccess point by using the SSID for the wireless infrastructure modereceived in the foregoing processing in the cableless setup mode. Whenthe connection processing is completed, information indicating thecompletion of the connection is stored in the nonvolatile memory 605. Instep S1902, the MFP 300 refers to this information to determine whetherany external access point is connected. Alternatively, for example, theMFP 300 may make the determination of step S1902, based on whether anSSID for the wireless infrastructure mode is set. The MFP 300 may makethe determination of step S1902, based on whether an Internet Protocol(IP) address is assigned to the MFP 300 by an external access point thatis a master station in the wireless infrastructure mode. In other words,the MFP 300 may make the determination of step S1902, based on whetheran external access point to be a communication partner apparatus isdetermined. The SSID that is used in the wireless infrastructure modemay be set by a different method other than in the cableless setup mode.In a case where no external access point is determined to be connected(NO in step S1902), the processing proceeds to step S1908. In stepS1908, the MFP 300 disables a wireless infrastructure mode priorityflag, and stores the information into the nonvolatile memory 605.

On the other hand, in a case where the MFP 300 determines that anexternal access point is connected (YES in step S1902), the processingproceeds to step S1903. In step S1903, the MFP 300 enables the wirelessinfrastructure mode priority flag, and stores the information into thenonvolatile memory 605.

In step S1904, the MFP 300 determines whether the MFP 300 is in P2P(WLAN) connection with an external communication apparatus. In responseto Receiving a P2P (WLAN) connection request, the MFP 300 performsconnection processing, and counts up the number of connections by oneupon completion of the connection processing. In a case where the numberof connections is one or more, then in step S1904, the MFP 300determines that the MFP 300 is in P2P (WLAN) connection. Alternatively,for example, the MFP 300 may make the determination of step S1904, basedon whether identification information (such as an IP address and anapparatus name) about a communication partner apparatus (for example,the terminal apparatus 200) to be the partner of the P2P (WLAN)connection is stored. In other words, the determination of step S1904may be made, based on whether the communication partner apparatus of theP2P (WLAN) connection is determined. In a case where the MFP 300 isdetermined to not be in P2P (WLAN) connection with an externalcommunication apparatus (NO in step S1904), the processing proceeds tostep S1909. In step S1909, the MFP 300 disables a P2P mode priorityflag, and stores the information into the nonvolatile memory 605.

On the other hand, in a case where the MFP 300 determines that the MFP300 is in P2P (WLAN) connection with an external communication apparatus(YES in step S1904), the processing proceeds to step S1905. In stepS1905, the MFP 300 enables the P2P mode priority flag, and stores theinformation into the nonvolatile memory 605.

In step S1906, the MFP 300 refers to the wireless infrastructure modepriority flag and the P2P mode priority flag, and determines which ofthe wireless control setting tables illustrated in FIGS. 20A, 20B, 20C,and 20D to use. More specifically, in a case where the wirelessinfrastructure mode priority flag is disabled and the P2P mode priorityflag is disabled, the MFP 300 determines to use the wireless controlsetting table of FIG. 20A (standby table). In a case where the wirelessinfrastructure mode priority flag is enabled and the P2P mode priorityflag is disabled, the MFP 300 determines to use the wireless controlsetting table of FIG. 20B (wireless infrastructure connection prioritytable). In a case where the wireless infrastructure mode priority flagis disabled and the P2P mode priority flag is enabled, the MFP 300determines to use the wireless control setting table of FIG. 20C (P2Pconnection priority table). In a case where the wireless infrastructuremode priority flag is enabled and the P2P mode priority flag is enabled,the MFP 300 determines to use the wireless control setting table of FIG.20D (full active table). The numerical values in the wireless controlsetting tables of FIGS. 20A, 20B, 20C, and 20D are just examples, andother values may be set.

In step S1907, the MFP 300 sets the wireless control setting tabledetermined in step S1906 into a wireless chip driver. Communicationperformed by the MFP 300 in the cases where the wireless control settingtables of FIGS. 20A, 20B, 20C, and 20D are set into the wireless chipdriver will be overviewed with reference to FIGS. 21A, 21B, 21C, and21D, respectively. The wireless chip driver refers to a module forcontrolling the wireless combination unit 616.

FIGS. 21A, 21B, 21C, and 21D illustrate the outlines of thecommunication in the cases where the CPU 602 sets the wireless controlsetting tables of FIGS. 20A, 20B, 20C, and 20D into the wireless chipdriver, respectively.

In FIGS. 21A to 21D, packets illustrated by white rectangles representones transmitted from the MFP 300. Packets illustrated by shadedrectangles represent ones received by the MFP 300. The horizontal axesindicate elapsed time. T in FIGS. 21A to 21D represents unit time. Thelengths of unit time T in FIGS. 21A to 21D are the same.

FIG. 21A illustrates an operation example in the case where the standbytable of FIG. 20A is set into the wireless chip driver. In other words,FIG. 21A illustrates an operation in the case where the MFP 300 is notconnected to the external access point 400 and not in P2P (WLAN)connection with the external communication apparatus. As is clear fromFIG. 21A, the MFP 300 performs communication so that a time divisionoccupancy period of the wireless infrastructure connection and that ofthe P2P (WLAN) connection are substantially the same. In FIG. 21A,packets 2101 received by the MFP 300 are beacons output from theexternal access point 400. The beacons include the SSID corresponding tothe external access point 400. In response to receiving the beacons, theMFP 300 transmits connection request packets 2102 based on useroperations on the MFP 300. For example, the MFP 300 receives a beacon(connection request packet 2101) output from the external access point400 with an SSID in a 5-GHz dynamic frequency selection (DFS) band, anddisplays the SSID included in the beacon (connection request packet2101). In a case where the user selects the SSID in the 5-GHz DFS bandto accept the connection instruction, a connection request packet 2102is transmitted. Packets 2103 received by the MFP 300 are ones for P2P(WLAN) connection. Examples include a Probe Request. In a case where thepackets 2103 are a Probe Request, packets 2104 are a Probe Response.

FIG. 21B illustrates an operation example in the case where the wirelessinfrastructure connection priority table of FIG. 20B is set into thewireless chip driver. In other words, FIG. 21B illustrates an operationin the case where the MFP 300 is connected to the external access point400 and not in P2P (WLAN) connection with the external communicationapparatus. As is clear from FIG. 21B, the MFP 300 performs communicationso that the time division occupancy period of the wirelessinfrastructure connection is longer than that of the P2P (WLAN)connection. The ratio corresponds to the values in FIG. 20B. The MFP 300can thus communicate with the access point 400 in the wirelessinfrastructure mode with sufficient communication speed. In FIG. 21B,the packets 2101 received by the MFP 300 are print data (data packets)received via the external access point 400, for example. In a case wherethe MFP 300 determines that the data packets are normal packets, the MFP300 transmits acknowledgement (ACK) packets (packets 2102).

The packet 2103 received by the MFP 300 is a packet for P2P (WLAN)connection. Examples include a Probe Request. In a case where the packet2103 is a Probe Request, the packet 2104 is a Probe Response.

FIG. 21C illustrates an operation example in the case where the P2Pconnection priority table of FIG. 20C is set into the wireless chipdriver. In other words, FIG. 21C illustrates an operation in the casewhere the MFP 300 is not connected to the external access point 400 andin P2P (WLAN) connection with the external communication apparatus. Asis clear from FIG. 21C, the MFP 300 performs communication so that thetime division occupancy period of the P2P (WLAN) connection is longerthan that of the wireless infrastructure connection. The ratiocorresponds to the values in FIG. 20C. The MFP 300 can thus communicatewith the external communication apparatus in the P2P (WLAN) mode withsufficient communication speed. In FIG. 21C, the packet 2101 received bythe MFP 300 is a beacon output from the external access point 400, forexample. The packet 2102 is a connection request packet transmittedbased on user operations on the MFP 300. A description thereof will beomitted here since a detailed description has been given with referenceto FIG. 21A. The packets 2103 received by the MFP 300 are print datareceived via the P2P (WLAN) connection. In a case where the MFP 300determines that the data packets are normal packets, the MFP 300transmits ACK packets (packets 2104).

FIG. 21D illustrates an operation example in the case where the fullactive table of FIG. 20D is set into the wireless chip driver. In otherwords, FIG. 21D illustrates an operation in the case where the MFP 300is connected to the external access point 400 and in P2P (WLAN)connection with the external communication apparatus. As is clear fromFIG. 21D, the MFP 300 performs communication so that the time divisionoccupancy period of the wireless infrastructure connection and that ofthe P2P (WLAN) connection are substantially the same. In FIG. 21D, thepackets 2101 received by the MFP 300 are print data received via theexternal access point 400, for example. In a case where the MFP 300determines that the data packets are normal packets, the MFP 300transmits ACK packets (packets 2102). The packets 2103 received by theMFP 300 are print data received via the P2P (WLAN) connection. In a casewhere the data packets are determined to be normal packets, the MFP 300transmits ACK packets (packets 2104). Now, return to FIG. 13 . In stepS1315, the MFP 300 enables the USB I/F. Then, the setting processingupon the initial activation ends. In other words, the USB I/F is enabledin both the cases where “wired LAN” is selected and where “wireless LAN”is selected. The MFP 300 does not necessarily need to enable the USBI/F, depending on settings based on user operations.

The CPU 602 of the MFP 300 can thus cause the wireless combination unit616 to perform communication processing based on the selected wirelesscontrol table, and a drop in communication throughput can be reduced bythe foregoing processing upon the initial activation. For example, adrop in communication throughput can be reduced by using the wirelesscombination unit 616 even in a case where different channels are used inthe wireless infrastructure mode and the P2P (WLAN) mode. Moreover, adrop in communication throughput can also be reduced by the foregoingprocessing even in a case where the channel used in the wirelessinfrastructure mode and that used in the P2P (WLAN) mode are the same.The MFP 300 can thus improve convenience in running the P2P (WLAN) modeand the wireless infrastructure mode in parallel by using commonhardware resources. In a case where the Bluetooth® Low Energy mode isenabled, the time division occupancies are determined by also takinginto account the connection status in the Bluetooth® Low Energy mode.For example, in a case where the Bluetooth® Low Energy mode is enabledon the MFP 300, the MFP 300 initially outputs Advertising data bycommunication in the Bluetooth® Low Energy mode. Here, the time divisionoccupancy is determined so that the beacon (Advertising data) can betransmitted at every 100 msec. The rest of the time may be divided basedon the contents of the tables in FIGS. 20A to 20D.

<Setting for Switching Communication Modes Between Enabled and DisabledBased on LAN Settings>

Next, a method for setting the wireless infrastructure mode and the P2P(WLAN) mode in switching the communication modes between enabled anddisabled will be described. The MFP 300 is configured so thatcommunication modes to be used can be enabled or disabled on the I/Fselection screen illustrated in FIG. 4C or via a cableless setup. TheMFP 300 can activate the cableless setup mode by the user operating anoperation screen of the MFP 300. Specifically, in a case where the useruses the operation screen of the MFP 300 to give an instruction for acableless setup, the MFP 300 activates the software AP mode as in stepS1304 and operates as an AP. In the present exemplary embodiment, thewired LAN and the wireless LAN are used in an exclusive manner, and theMFP 300 is unable to enable the wireless LAN with the wired LAN enabled.Similarly, the MFP 300 is unable to enable the wired LAN with thewireless LAN enabled. However, the wired LAN and the wireless LAN can bedisabled in parallel. In the present exemplary embodiment, theBluetooth® communication function is also implemented by the wirelesscombination unit 616 like the wireless LAN. The Bluetooth® communicationfunction is thus configured to not be enabled while the wired LAN isenabled. The USB I/F is unable to be disabled by the user's setting. TheUSB I/F is always enabled upon activation of the MFP 300, and configuredto be usable with the wired LAN, the wireless LAN, or Bluetooth® LowEnergy in parallel. The MFP 300 is configured to enable or disable thewireless infrastructure mode and the P2P (WLAN) mode independently. Forexample, the user gives an instruction to enable wireless direct (i.e.,the P2P (WLAN) mode) using the I/F selection screen, and then gives aninstruction to enable the wireless infrastructure mode. Based on suchinstructions, the MFP 300 can enable the P2P (WLAN) mode and thewireless infrastructure mode in parallel. In other words, the MFP 300can maintain the wireless connection in the P2P (WLAN) mode and thewireless connection in the wireless infrastructure mode in parallel.While the connections can be maintained in parallel, data communicationis performed not in parallel but sequentially. For example, in a casewhere the wireless connection in the P2P (WLAN) mode and the wirelessconnection in the wireless infrastructure mode are maintained inparallel, the MFP 300 initially performs data communication in thewireless infrastructure mode for a predetermined period, and thenperforms data communication in the P2P (WLAN) mode. The MFP 300 is alsoconfigured so that the Bluetooth® Low Energy mode can be enabled anddisabled independent of the P2P (WLAN) mode and the wirelessinfrastructure mode. Here, the Bluetooth® Low Energy mode can be enabledalong with the P2P (WLAN) mode and/or the wireless infrastructure modein parallel. In other words, the MFP 300 can maintain the wirelessconnections in the P2P (WLAN) mode and the wireless infrastructure modeand the wireless connection in the Bluetooth® Low Energy mode inparallel. The MFP 300 can thus maintain the wireless connection in theP2P (WLAN) mode, the wireless connection in the wireless infrastructuremode, and the wireless connection using Bluetooth® Low Energy inparallel. The enabled/disabled states are stored in the nonvolatilememory 605, and the MFP 300 refers to the information upon nextactivation after power-off and enables the communication modes based onthe stored information. In a case where the LAN setting items areinitialized, the MFP 300 disables the respective communication modes. Insuch a case, the MFP 300 also disables the wired LAN and enters a stateof performing neither the wired LAN communication nor the wireless LANcommunication. In a case where the LAN settings are initialized, theuser uses the MFP 300 by individually performing setting changes toenable desired communication modes.

Processing in a case where the user operates the operation screen of theMFP 300 to perform settings to enable or disable the wirelessinfrastructure mode and the P2P (WLAN) mode independently will bedescribed with reference to FIG. 14 .

After the completion of the foregoing initial activation processing(S1301 to S1315), in step S1401, the MFP 300 displays a normal standbyscreen (home screen) (FIG. 4A).

In step S1402, the MFP 300 displays the I/F selection screen (FIG. 4C)in response to the user's operation on the normal standby screen. Instep S1403, the MFP 300 determines whether either “wireless LAN” or“wireless direct” is selected.

In a case where the MFP 300 determines that neither “wireless LAN” nor“wireless direct” is selected (NO in step S1403), the processingproceeds to step S1404. In step S1404, the MFP 300 activates theselected I/F. Then, the processing ends. For example, in a case where“wired LAN” is selected in FIG. 4C, the determination of step S1403 isNO.

On the other hand, in a case where the MFP 300 determines that either“wireless LAN” or “wireless direct” is selected on the I/F selectionscreen of FIG. 4C (YES in step S1403), the processing proceeds to stepS1405. In step S1405, the MFP 300 determines whether the wirelessinfrastructure mode is selected. In a case where the MFP 300 determinesthat the wireless infrastructure mode is selected (YES in step S1405),the processing proceeds to step S1406. In step S1406, the MFP 300determines whether the wireless infrastructure mode is enabled by a useroperation. In a case where the MFP 300 determines that the wirelessinfrastructure mode is enabled (YES in step S1406), the processingproceeds to step S1407. In step S1407, the MFP 300 performs wirelessinfrastructure mode enabling processing. The wireless infrastructuremode enabling processing will be described with reference to FIG. 15 .

In step S1501, the MFP 300 enables the wireless infrastructure mode,based on the user operation on the operation screen. In step S1502, theMFP 300 searches for access points nearby and displays a list of SSIDs.In step S1503, the MFP 300 determines an access point to connect to,based on user operations. In step S1504, the MFP 300 performs connectionprocessing with the selected access point.

In step S1505, the MFP 300 determines whether the connection to theaccess point is completed. In a case where the MFP 300 determines thatthe connection to the access point is not completed (NO in step S1505),the processing returns to step S1504.

On the other hand, in a case where the MFP 300 determines that theconnection to the access point is completed (YES in step S1505), theprocessing proceeds to step S1506. In step S1506, the MFP 300 performswireless control table setting processing. Since the wireless controltable setting processing is similar to the processing of steps S1901 toS1910 described above, a redundant detailed description thereof will beomitted and brief examples will be given. For example, in a case wherethe MFP 300 is operating in only the wireless infrastructure modeenabled by an operation on the I/F selection screen displayed in stepS1402, the determination of step S1901 is NO and the occupancy of thewireless infrastructure mode is set to 100%. By contrast, in a casewhere the MFP 300 is operating in both the wireless infrastructure modeand the P2P (WLAN) mode enabled by operations on the I/F selectionscreen displayed in step S1402, the determination of step S1901 is YESand steps S1902 to S1907 are performed. Returning to FIG. 14 , thewireless infrastructure mode enabling processing ends. In the processingprocedure of FIG. 15 , the processing of S1506 is described to not beperformed until the determination of step S1505 is YES. However, otherprocessing procedures may be performed. Specifically, in a case wherethe determination of step S1505 is NO, the MFP 300 retries theprocessing of step S1504. The MFP 300 may then perform step S1506 in acase where the number of retries of step S1504 reaches a predeterminednumber and even in a case where the connection processing with theaccess point is not completed.

In a case where the MFP 300 determines that the wireless infrastructuremode is not enabled (NO in step S1406), the processing proceeds to stepS1408. In step S1408, the MFP 300 determines whether the wirelessinfrastructure mode is disabled by a user operation. In a case where theMFP 300 determines that the wireless infrastructure mode is not disabled(NO in step S1408), the processing ends.

On the other hand, in a case where the MFP 300 determines that thewireless infrastructure mode is disabled (YES in step S1408), theprocessing proceeds to step S1409. In step S1409, the MFP 300 performswireless infrastructure mode disabling processing. The wirelessinfrastructure mode disabling processing will be described withreference to FIG. 16 .

In a case where the user operates the operation screen to disable thewireless infrastructure mode, then in step S1601, the MFP 300 determineswhether an external access point is connected. In a case where the MFP300 determines that no external access point is connected (NO in stepS1601), the processing proceeds to step S1603. On the other hand, in acase where the MFP 300 determines that an external access point isconnected (YES in step S1601), the processing proceeds to step S1602. Instep S1602, the MFP 300 performs disconnection processing with theexternal access point. The processing proceeds to step S1603.

In step S1603, the MFP 300 disables the wireless infrastructure mode. Instep S1604, the MFP 300 performs wireless control table settingprocessing. Since the wireless control table setting processing issimilar to the processing of steps S1901 to S1910 described above, aredundant detailed description thereof will be omitted. Returning toFIG. 14 , the wireless infrastructure mode disabling processing of stepS1409 ends.

In a case where the MFP 300 determines that the wireless infrastructuremode is not selected (NO in step S1405), the processing proceeds to stepS1410. In step S1410, the MFP 300 determines whether “wireless direct”(i.e., the P2P (WLAN) mode) is selected on the I/F selection screen ofFIG. 4C. In a case where the MFP 300 determines that the P2P (WLAN) modeis not selected (NO in step S1410), the processing ends. On the otherhand, in a case where the MFP 300 determines that the P2P (WLAN) mode isselected (YES in step S1410), the processing proceeds to step S1411. Instep S1411, the MFP 300 determines whether the P2P (WLAN) mode isenabled by a user operation. In a case where the MFP 300 determines thatthe P2P (WLAN) mode is enabled (YES in step S1411), the processingproceeds to step S1412. In step S1412, the MFP 300 performs P2P (WLAN)mode enabling processing. The P2P (WLAN) mode enabling processing willbe described with reference to FIG. 17 .

In response to a user operation on the operation screen and the P2P(WLAN) mode is enabled, then in step S1701, the MFP 300 activates amaster station in the P2P (WLAN) mode and enters a P2P (WLAN) connectionrequest waiting state. The master station activated in step S1701 may bea software AP or a Wi-Fi Direct group owner. In step S1702, the MFP 300determines whether there is a connection request in the P2P (WLAN) mode.In a case where the MFP 300 determines that there is no connectionrequest in the P2P (WLAN) mode (NO in step S1702), the processingreturns to step S1702 to enter the P2P (WLAN) connection request waitingstate again. On the other hand, in a case where the MFP 300 determinesthat there is a connection request in the P2P (WLAN) mode (YES in stepS1702), the processing proceeds to step S1703. In step S1703, the MFP300 performs P2P (WLAN) connection processing.

In step S1704, the MFP 300 determines whether the P2P (WLAN) connectionis completed. In a case where the MFP 300 determines that the P2P (WLAN)connection is not completed (NO in step S1704), the processing returnsto step S1702 and the MFP 300 enters the P2P (WLAN) connection requestwaiting state again. On the other hand, in a case where the MFP 300determines that the P2P (WLAN) connection is determined to be completed(YES in step S1704), the processing proceeds to step S1705. In stepS1705, the MFP 300 performs wireless control table setting processing.Since the wireless control table setting processing of step S1705 issimilar to that of steps S1901 to S1910 described above, a detailedredundant description thereof will be omitted. Returning to FIG. 14 ,the P2P (WLAN) mode enabling processing of step S1412 ends. In theprocessing procedure of FIG. 17 , the processing of S1705 is describedto not be performed until the determination of step S1704 is YES.However, other processing procedures may be performed. Specifically, theMFP 300 may perform step S1705 in a case where a predetermined time haselapsed without receiving the P2P (WLAN) mode connection request.Alternatively, in a case where the determination of step S1704 is NO,the MFP 300 retries the processing of steps S1702 and S1703. The MFP 300may then perform step S1705 in a case where the number of retries ofstep S1703 reaches a predetermined number and the connection processingin the P2P (WLAN) mode is not completed.

On the other hand, in a case where the MFP 300 determines that the P2P(WLAN) mode is not enabled (NO in step S1411), the processing proceedsto step S1413. In step S1413, the MFP 300 determines whether the P2P(WLAN) mode is disabled. In a case where the MFP 300 determines that theP2P (WLAN) mode is not disabled (NO in step S1413), the processing ends.

In a case where the MFP 300 determines that the P2P (WLAN) mode isdisabled (YES in step S1413), the processing proceeds to step S1414. Instep S1414, the MFP 300 performs P2P (WLAN) mode disabling processing.The P2P (WLAN) mode disabling processing will be described withreference to FIG. 18 .

In a case where the user operates the operation screen to input aninstruction to disable the wireless direct (P2P (WLAN) mode), then instep S1801, the MFP 300 determines whether the MFP 300 is in P2P (WLAN)connection with an external communication apparatus.

In a case where the MFP 300 determines that the MFP 300 is not in P2P(WLAN) connection with any external communication apparatus (NO in stepS1801), the processing proceeds to step S1803. On the other hand, in acase where the MFP 300 determines that the MFP 300 is in P2P (WLAN)connection with an external communication apparatus (YES in step S1801),the processing proceeds to step S1802. In step S1802, the MFP 300performs disconnection processing with the external communicationapparatus. The processing proceeds to step S1803.

As the P2P (WLAN) mode disabling processing, in step S1803, the MFP 300stops the master station in the P2P (WLAN) mode. In step S1804, the MFP300 performs wireless control table setting processing. Since thewireless control table setting processing is similar to the processingof steps S1901 to S1910 described above, a detailed redundantdescription thereof will be omitted. Returning to FIG. 14 , the P2P(WLAN) mode disabling processing ends.

The MFP 300 can thus cause the wireless combination unit 616 to performcommunication processing based on the selected wireless control table,and a drop in communication throughput in switching the communicationmodes between enabled and disabled can be reduced. For example, a dropin communication throughput can be reduced by using the wirelesscombination unit 616 even in a case where different channels are used inthe wireless infrastructure mode and the P2P (WLAN) mode. Moreover, adrop in communication throughput can also be reduced by the foregoingprocessing even in a case where the channel that is used in the wirelessinfrastructure mode and that is used in the P2P (WLAN) mode are thesame. The MFP 300 can thus improve the convenience in running the P2P(WLAN) mode and the wireless infrastructure mode in parallel by usingcommon hardware resources. In a case where the Bluetooth® Low Energymode is enabled, the time division occupancies are determined by alsotaking into account the connection status in the Bluetooth® Low Energymode. For example, in a case where the Bluetooth® Low Energy mode isenabled on the MFP 300, the MFP 300 initially outputs Advertising databy communication in the Bluetooth® Low Energy mode. Here, the timedivision occupancy is determined so that the beacon (Advertising data)can be transmitted at every 100 msec. The rest of the time may bedivided based on the contents of the tables in FIGS. 20A to 20D.

As described above, the MFP 300 according to the present exemplaryembodiment can appropriately set the durations of the respectivecommunication periods in the wireless infrastructure mode and the P2P(WLAN) mode per unit time, based on the connection states. The MFP 300then sets the communication periods of a respective plurality ofcommunication modes, based on priorities and time division occupanciesidentified. This enables appropriate allocation of communication periodsto communication modes where high throughput is desired.

Other Exemplary Embodiments

In the foregoing exemplary embodiment, the modes in which communicationcompliant with the wireless LAN standard is performed are described asexamples of the communication modes to be used. However, thecommunication apparatuses may be configured so that communication modesof other wireless communication standards can be used. For example, in acase where the wireless LAN standard is modified, another wireless LANstandard is added, or a new wireless communication standard isavailable, the foregoing discussion can be applied by using the added ormodified wireless LAN standard or the new wireless communicationstandard. For example, the foregoing discussion is also applicable in acase where a new connection mode is made usable by the addition ormodification of a wireless communication standard.

In the foregoing example, whether to use the standby table or to use thewireless infrastructure connection priority table or the P2P connectionpriority table is described to be determined based on whether externalapparatuses are connected in the wireless infrastructure mode and theP2P (WLAN) mode. However, this is not restrictive, and which of thetables of FIGS. 20A to 20D to use may be determined based on a user'sinstruction. More specifically, even in a case where the MFP 300 isconnected to the access point 400 and in P2P (WLAN) connection with theexternal communication apparatus, the wireless infrastructure connectionpriority table may be determined based on a user instruction when theuser wants to give higher priority to the wireless infrastructureconnection.

In the foregoing exemplary embodiment, the processing is described to beperformed by the MFP 300. However, the processing may be performed bydevices other than an MFP (such as a digital camera and a smartphone).

To improve throughput, the MFP 300 may perform communication with a40-MHz frequency bandwidth using a plurality of channels forcommunication, depending on the situation. For example, in a case wherethe P2P (WLAN) mode is disabled and the wireless infrastructure mode isenabled, the MFP 300 waits in an operable state in both a 20-MHz modeand a 40-MHz mode. Then, in a case where the MFP 300 receivesinformation indicating that the external access point 400 is capable of40-MHz communication, the MFP 300 may determine to operate in the 40-MHzmode. The 40-MHz mode is supported by IEEE 802.11n. In a case where theMFP 300 joins a 2.4-GHz wireless network constructed by the externalaccess point 400 in the 40-MHz mode, the MFP 300 periodically performsan overlapping basic service set (OBSS) scan in compliance with the IEEE802.11n standard. Wireless networks not supporting the IEEE 802.11n ornot accommodating communication in the 40-MHz mode can be found by anOBSS scan. In a case where such wireless networks are found, the MFP 300transmits a report to the external access point 400. The external accesspoint 400 receiving the report switches from the wireless networksupporting the 40-MHz mode to a wireless network supporting only the20-MHz mode as appropriate. The MFP 300 may perform communication withother frequency bandwidths.

In the foregoing exemplary embodiment, 2.4 GHz and 5 GHz are describedas the frequencies to be used, whereas other frequencies may be used.For example, 6 GHz may be used.

An exemplary embodiment of the present disclosure can also beimplemented by processing for supplying a program for implementing oneor more functions of the foregoing exemplary embodiment to a system oran apparatus via a network or a storage medium, and reading andexecuting the program by one or more processors in a computer of thesystem or apparatus. A circuit for implementing one or more functions(such as an application specific integrated circuit (ASIC)) may be usedfor implementation.

According to an exemplary embodiment of the present disclosure,convenience of wireless communication can be improved.

Other Embodiments

Embodiment(s) of the present invention can also be realized by acomputer of a system or apparatus that reads out and executes computerexecutable instructions (e.g., one or more programs) recorded on astorage medium (which may also be referred to more fully as a‘non-transitory computer-readable storage medium’) to perform thefunctions of one or more of the above-described embodiment(s) and/orthat includes one or more circuits (e.g., application specificintegrated circuit (ASIC)) for performing the functions of one or moreof the above-described embodiment(s), and by a method performed by thecomputer of the system or apparatus by, for example, reading out andexecuting the computer executable instructions from the storage mediumto perform the functions of one or more of the above-describedembodiment(s) and/or controlling the one or more circuits to perform thefunctions of one or more of the above-described embodiment(s). Thecomputer may comprise one or more processors (e.g., central processingunit (CPU), micro processing unit (MPU)) and may include a network ofseparate computers or separate processors to read out and execute thecomputer executable instructions. The computer executable instructionsmay be provided to the computer, for example, from a network or thestorage medium. The storage medium may include, for example, one or moreof a hard disk, a random-access memory (RAM), a read only memory (ROM),a storage of distributed computing systems, an optical disk (such as acompact disc (CD), digital versatile disc (DVD), or Blu-ray Disc (BD)™),a flash memory device, a memory card, and the like.

While the present invention has been described with reference toexemplary embodiments, it is to be understood that the invention is notlimited to the disclosed exemplary embodiments. The scope of thefollowing claims is to be accorded the broadest interpretation so as toencompass all such modifications and equivalent structures andfunctions.

What is claimed is:
 1. A communication apparatus that includes acommunication unit configured to perform a first communication mode inwhich the communication unit communicates with a terminal apparatus viawireless communication with an external wireless base station and asecond communication mode in which the communication unit directlyperforms wireless communication with the terminal apparatus withoutintervention of the external wireless base station, the communicationapparatus comprising: a setting unit configured to enable at leasteither one of the first communication mode and the second communicationmode; and a control unit configured to perform communication processingin the first communication mode and the second communication mode insuch a manner that a time used for the second communication mode perunit time is longer than that for the first communication mode in a casewhere both the first communication mode and the second communicationmode are enabled, a communication partner apparatus in the secondcommunication mode is determined, and an external wireless base stationin the first communication mode is not determined.
 2. The communicationapparatus according to claim 1, wherein a Probe Request is receivedduring the time used for the second communication mode.
 3. Thecommunication apparatus according to claim 2, wherein a beacontransmitted from the external wireless base station is received duringthe time used for the first communication mode.
 4. The communicationapparatus according to claim 1, wherein the control unit is configuredto perform the communication processing in the first communication modeand the second communication mode in such a manner that the time usedfor the first communication mode per unit time is longer than that forthe second communication mode in a case where both the firstcommunication mode and the second communication mode are enabled, acommunication partner apparatus in the first communication mode isdetermined, and the communication partner apparatus in the secondcommunication mode is not determined.
 5. The communication apparatusaccording to claim 1, wherein the control unit is configured to performthe communication processing in the first communication mode and thesecond communication mode to set communication periods of the firstcommunication mode and second communication mode per unit time to besubstantially the same in a case where both the first communication modeand the second communication mode are enabled and a communicationpartner apparatus in the first communication mode and the communicationpartner apparatus in the second communication mode are determined. 6.The communication apparatus according to claim 1, wherein the controlunit is configured to perform the communication processing in the firstcommunication mode and second communication mode to set communicationperiods of the first communication mode and the second communicationmode per unit time to be substantially the same in a case where both thefirst communication mode and the second communication mode are enabledand neither a communication partner apparatus in the first communicationmode nor the communication partner apparatus in the second communicationmode is determined.
 7. The communication apparatus according to claim 1,wherein the first communication mode and the second communication modeare communication modes compliant with an Institute of Electrical andElectronics Engineers (IEEE) 802.11 standard.
 8. The communicationapparatus according to claim 1, wherein the communication unit isconfigured to operate as a master station of a wireless network in thesecond communication mode.
 9. The communication apparatus according toclaim 1, further comprising a print control unit configured to performprint processing, based on print data received by the wirelesscommunication in at least either one of the first communication mode andthe second communication mode.
 10. The communication apparatus accordingto claim 1, wherein the external wireless base station is an accesspoint.
 11. A communication apparatus that includes a communication unitconfigured to perform a first communication mode in which thecommunication unit communicates with a terminal apparatus via wirelesscommunication with an external wireless base station and a secondcommunication mode in which the communication unit directly performswireless communication with the terminal apparatus without interventionof the external wireless base station, the communication apparatuscomprising: a setting unit configured to enable at least either one ofthe first communication mode and the second communication mode; and acontrol unit configured to perform communication processing in the firstcommunication mode and the second communication mode in such a mannerthat a time used for the first communication mode per unit time islonger than that for the second communication mode in a case where boththe first communication mode and the second communication mode areenabled, an external wireless base station in the first communicationmode is determined, and a communication partner apparatus in the secondcommunication mode is not determined.
 12. The communication apparatusaccording to claim 11, wherein a Probe Request is received during thetime used for the second communication mode.
 13. The communicationapparatus according to claim 12, wherein a beacon transmitted from theexternal wireless base station is received during the time used for thefirst communication mode.
 14. The communication apparatus according toclaim 11, wherein the control unit is configured to performcommunication processing in the first communication mode and the secondcommunication mode in such a manner that the time used for the secondcommunication mode per unit time is longer than that for the firstcommunication mode in a case where both the first communication mode andthe second communication mode are enabled, the communication partnerapparatus in the second communication mode is determined, and acommunication partner apparatus in the first communication mode is notdetermined.
 15. The communication apparatus according to claim 11,wherein the control unit is configured to perform the communicationprocessing in the first communication mode and the second communicationmode to set communication periods of the first communication mode andsecond communication mode per unit time to be substantially the same ina case where both the first communication mode and the secondcommunication mode are enabled and a communication partner apparatus inthe first communication mode and the communication partner apparatus inthe second communication mode are determined.
 16. The communicationapparatus according to claim 11, wherein the control unit is configuredto perform the communication processing in the first communication modeand second communication mode to set communication periods of the firstcommunication mode and the second communication mode per unit time to besubstantially the same in a case where both the first communication modeand the second communication mode are enabled and neither acommunication partner apparatus in the first communication mode nor thecommunication partner apparatus in the second communication mode isdetermined.
 17. The communication apparatus according to claim 11,wherein the first communication mode and the second communication modeare communication modes compliant with an Institute of Electrical andElectronics Engineers (IEEE) 802.11 standard.
 18. The communicationapparatus according to claim 11, wherein the communication unit isconfigured to operate as a master station of a wireless network in thesecond communication mode.
 19. The communication apparatus according toclaim 11, further comprising a print control unit configured to performprint processing, based on print data received by the wirelesscommunication in at least either one of the first communication mode andthe second communication mode.
 20. The communication apparatus accordingto claim 11, wherein the external wireless base station is an accesspoint.